Overview of SATA Protocol
With the need for large-scale memory systems for various applications in recent decades has come the need to standardize communication with large-scale memory systems in an effort to increase flexibility of use thereof.
SATA is a high-speed serial link replacement for the parallel Advanced Technology Attachment (ATA) attachment of mass storage devices. The serial link employed is a point-to-point high-speed differential link that utilizes gigabit technology and 8b/10b encoding known to those of ordinary skill in the art. The SATA protocol is based on a layered communication model similar to Open Systems Interconnection (OSI) Reference Model. An overview is presented below. For more detail, the reader is referred to the SATA standard or specification, incorporated herein by reference, and provided in the publication entitled “Serial ATA: High Speed Serialized ATA Attachment” or “Serial ATA International Organization: Serial ATA Revisions 2.5, dated Oct. 27, 2005, and the publication entitled “Serial ATA II: Extensions to Serial ATA 1.0”, Revision 2.5, dated Oct. 16, 2002, both of which are currently available at Serial ATA work group web site www.serialata.org.
In the SATA protocol, each layer of protocol communicates with its counterpart directly or indirectly. The serial ATA link is defined by a protocol pursuant to a known standard, having four layers of communications, the physical layer for performing communication at a physical level, a link layer, a transport layer and an application layer or sometimes referred thereto as a command layer. A transmitter and a receiver, cannot directly communicate the latter with each other, rather, they must go through the other layers of their system prior to reaching a corresponding layer of the other. For example, for the physical layer of a transmitter to communicate with the transport layer of the receiver, it must first go through the link, transport and application layers of the transmitter and then through the serial ATA link to the application layer of the receiver and finally to the transport layer of the receiver.
The basic unit of communication or exchange is a frame. A frame comprises of a start of frame (SOF) and end of frame (EOF), which are different delimiters in accordance with the SATA and SAS specifications. In SATA, an STP comprises a frame information structure (FIS), a Cyclic Redundancy Checksum (CRC) calculated over the contents of the FIS and an end of frame (EOF) primitive. The serial ATA organization has defined a specification in which the definition of a frame is provided and which is intended to be used throughout this document. Primitives are double word (Dword) entities that are used to control and provide status of the serial line. The serial ATA organization has defined a specification in which the definition of allowed Primitives is provided and which is intended to be used throughout this document
FIG. 1 shows an example of a frame 30. The frame, in FIG. 1, starts with an SOF primitive 30a, followed by a first FIS content 30b, followed by a HOLD primitive 30c indicating that the transmitter does not have data available, followed by a second FIS content 30d, followed by a HOLDA primitive 30e sent to acknowledge receipt of HOLD primitive, sent by the receiver, indicating that the receiver buffer is in a ‘not ready’ condition, followed by a CRC 30f and an EOF primitive 30g. 
The frame 30, in FIG. 1, includes two primitives a HOLD and a HOLDA primitive used for flow control. A HOLD primitive indicates inability to send or to receive FIS contents. A HOLDA primitive is sent to acknowledge receipt of a HOLD primitive. For example, when a receiving node detects that its buffer is almost full, it will send a HOLD primitive to a transmitting node, requesting the transmitter node to stop and when the buffer is ready to receive more data, the receiving node will stop sending a HOLD primitive. The transmitting node sends a HOLDA primitive to acknowledge receipt of the HOLD primitive. Until receipt of the HOLDA primitive, the receiving node continues receiving data. In order to prevent a buffer overrun, the SATA protocol requires a maximum delay of 20 Dwords between a node sending the HOLD primitive and receiving a HOLDA primitive.
There are a number of different frame types. For example, to send data via Direct Memory Access (DMA), a frame known as DMA setup FIS is utilized followed by a DMA data FIS. There are generally three types of FIS structures, one for commands, one for setting up a transfer and another for data relating to the transfer. Each frame structure is used for a different purpose. A command type of frame is sent to execute a command, a setup frame is used to prepare for the data transfer phase of the command and a data frame is used to transfer data.
A “SATA drive”, as used herein, refers to a media or disk drive conforming to the SATA standard for transferring information from and to the drive. The interface between the drive and the device coupled thereto is defined by the SATA standard. A “SATA port” is a port adhering to the SATA standard. A “SATA drive” is an example of a “SATA device” and a “SATA device” is an example of a “target”. A “target” is a device that accepts commands and responds to received commands.
There is a need for a device or apparatus for bridging communication between SATA and SAS devices, such as a SATA host and a SATA device or a SAS host and a SATA device or multiple SAS devices with a SATA device.
Using SAS as a link, three different types of communication protocols may be employed to open a connection. They are Serial ATA Tunneled Protocol (STP), SSP and SMP. STP is used in SATA. STP is used to allow SATA communication methods which are defined in the SATA standard, SSP and SMP are used to allow small computer system interface (SCSI) types of communication which is defined in the SAS standards.
Once an STP connection is ‘opened’, the SATA protocol is generally followed. Once an SMP connection is ‘opened’, an SMP protocol is followed. More specifically, a connection is opened and a connection is established, a request frame is sent by an initiator, a response frame is sent by a target and the connection is closed. The foregoing communication technique and further information regarding SAS is found in the SAS standard, a copy of which is located by referring the web site: www.t10.org. A request from the initiator includes a function code within which an area is reserved, as a vendor unique area, to be used to further define a function to be performed by, for example, a target.
An “initiator”, as used herein, refers to a unit or device that sends commands and is capable of receiving responses to sent commands. A “target”, as used herein, refers to a unit or device capable of receiving commands.
By way of background, idle data, or idle dwords, are use in SAS and scrambled data is used in SATA. In SAS, each link transmits primitives, frames and idle dwords. Idle dwords are filler dwords appearing in between the frames and primitives. A receiving PHY discards this data and only uses it to maintain synchronization. Typically, a random generator is used to generate idle dwords. In SATA, scrambled data which works in a similar way. A SATA_CONT primitive is sent then scrambled data is transmitted. Scrambled data is typically generated by a random generator. The fact that this is scrambled data to the system means that the data represents the primitive sent right before SATA_CONT, regardless of the value of the scrambled data. The scrambled data value is insignificant because the scrambled data is used only for synchronization purposes and indicated continuity, or not, of the data being transmitted.
Yet another problem with current systems is the inability to readily debug or test communication systems using SATA and/or SAS as protocol. The devices making up the system act based on frames and primitives. This is all the information that passes through the links. There however is other information in the devices that would help in debugging problems in the system. The problem is how to capture this information. There are bus analyzers that capture data on the links. However if this debug information is not on the link then the bus analyzer will not capture this information.
In light of the foregoing, the need arises for a high-performance device allowing communication, in the form of debug or test information, available from an analyzer to be captured, to a storage device.